package com.lam.framework.bean.entity;

import java.util.Date;

import javax.validation.constraints.Null;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.components.easyexcel.converter.DictConverter;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.validate.annotation.DictValid;
import com.lam.common.validate.group.Add;

/**
 * 文件记录对象 sys_file
 * 
 * @author admin
 * @date 2023-04-24
 */
@DictCheck
@ColumnWidth(30)
@TableName("sys_file")
public class SysFile implements BaseEntity{

    /** 主键 */
    @ExcelIgnore
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 文件路径签名 */
    @ExcelProperty("文件路径签名")
    private String sign;

    /** 文件路径 */
    @ExcelProperty("文件路径")
    private String filePath;

    /** 文件类型 */
    @ExcelProperty(value = "文件类型", converter = DictConverter.class)
    @DictValid(message = "无效的文件类型")
    @Dict(dictCode = "file_type")
    private String fileType;

    /** 文件大小 */
    @ExcelProperty("文件大小")
    private Integer fileSize;

    /** 类型(1-附件上传, 2-临时下载, 3-临时上传, 4-头像) */
    @ExcelProperty(value = "类型", converter = DictConverter.class)
    @DictValid(message = "无效的类型")
    @Dict(dictCode = "file_busi_type")
    private Integer busiType;

    /** 签名key的MD5值, 本地存储的文件需要此字段 */
    @ExcelProperty("签名key的MD5值")
    private String keyMd5;

    /** 存储位置(1-本地存储, 2-七牛云) */
    @ExcelProperty(value = "存储位置", converter = DictConverter.class)
    @DictValid(message = "无效的存储位置")
    @Dict(dictCode = "upload_type")
    private Integer location;

    /** 状态（1-正常, 0-不可下载, 2-已删除） */
    @ExcelProperty(value = "状态", converter = DictConverter.class)
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "file_status")
    private Integer status;

    /** 使用标识(1-已使用, 0-未使用) */
    @ExcelProperty(value = "使用标识", converter = DictConverter.class)
    @DictValid(message = "无效的使用标识")
    @Dict(dictCode = "file_use_flag")
    private Integer useFlag;

    /** 过期时间 */
    @ExcelProperty("过期时间")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    private Date expireTime;

    /** 创建人 */
    @ExcelIgnore
    private String createBy;

    /** 创建时间 */
    @ExcelIgnore
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 备注 */
    @ExcelProperty("备注")
    private String remark;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getSign() {
        return sign;
    }    
    
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getFilePath() {
        return filePath;
    }    
    
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileType() {
        return fileType;
    }    
    
    public void setFileSize(Integer fileSize) {
        this.fileSize = fileSize;
    }

    public Integer getFileSize() {
        return fileSize;
    }    
    
    public void setBusiType(Integer busiType) {
        this.busiType = busiType;
    }

    public Integer getBusiType() {
        return busiType;
    }    
    
    public void setKeyMd5(String keyMd5) {
        this.keyMd5 = keyMd5;
    }

    public String getKeyMd5() {
        return keyMd5;
    }    
    
    public void setLocation(Integer location) {
        this.location = location;
    }

    public Integer getLocation() {
        return location;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setUseFlag(Integer useFlag) {
        this.useFlag = useFlag;
    }

    public Integer getUseFlag() {
        return useFlag;
    }    
    
    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() {
        return expireTime;
    }    
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }    
    

}
